package com.lantosec.hmrp.modules.category.entity;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.category.vo.AssetsSupplierDirectoryVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 供应商及厂家目录 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-31
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AssetsSupplierDirectory extends BaseEntity<AssetsSupplierDirectoryVO> {

    private static final long serialVersionUID = 1L;
    public AssetsSupplierDirectory(AssetsSupplierDirectoryVO vo){
        this.supplierId = vo.getSupplierId();
        this.supplier = vo.getSupplier();
        this.type = vo.getType();
        this.manualFlag = vo.getManualFlag();
    }

    @Override
    public AssetsSupplierDirectoryVO convertToVO(){
        return new AssetsSupplierDirectoryVO(this);
    }


    /**
     * ID(his目录直接取，手工录入格式：SUPxxxx)
     */
    @TableId(value = "supplier_id", type = IdType.ASSIGN_UUID)
    private String supplierId;

    /**
     * 名称
     */
    private String supplier;

    /**
     * 类型(his目录直接取，手工录入留空)
     */
    private String type;

    /**
     * 是否手工录入(0 否,来自his目录；1 是)
     */
    private Integer manualFlag;


    public enum ColName {
        supplier_id, supplier, type, manual_flag, 
    }
}
